<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>4-盒子自动内减</title>
    <style>
        .box{
            width: 500px;
            height: 500px;
            border: 5px solid red;
            margin:0 auto;
            padding: 150px 0 0 150px;
            /* 自动内减 */
            box-sizing: border-box;
        }
        /* 需求：小盒子居中显示 */
        /* 1.外边距居中 */
        .son{
            width:200px;
            height:200px;
            background: blue;
            /* margin-left: 150px;
            margin-top:150px; */
            /* 上右下左 */
            margin:150px 0 0 150px;
        }
        /* 2.内边距 */
        .son{
            width: 200px;
            height: 200px;
            background: blue;
            margin: 0 0 0 0;
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="son"></div>
    </div>
</body>
</html>